package com.example.project10;

/**
 * Book实体类
 * 表示书籍信息的数据模型
 */
public class Book {
    private int id;
    private String bookNumber;  // 书号
    private String bookName;    // 书名
    private String userEmail;   // 所属用户邮箱

    // 构造函数
    public Book() {}

    public Book(String bookNumber, String bookName, String userEmail) {
        this.bookNumber = bookNumber;
        this.bookName = bookName;
        this.userEmail = userEmail;
    }

    public Book(int id, String bookNumber, String bookName, String userEmail) {
        this.id = id;
        this.bookNumber = bookNumber;
        this.bookName = bookName;
        this.userEmail = userEmail;
    }

    // Getter和Setter方法
    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getBookNumber() {
        return bookNumber;
    }

    public void setBookNumber(String bookNumber) {
        this.bookNumber = bookNumber;
    }

    public String getBookName() {
        return bookName;
    }

    public void setBookName(String bookName) {
        this.bookName = bookName;
    }

    public String getUserEmail() {
        return userEmail;
    }

    public void setUserEmail(String userEmail) {
        this.userEmail = userEmail;
    }

    @Override
    public String toString() {
        return "Book{" +
                "id=" + id +
                ", bookNumber='" + bookNumber + '\'' +
                ", bookName='" + bookName + '\'' +
                ", userEmail='" + userEmail + '\'' +
                '}';
    }
}